package com.fulu.game.bi.controller.play;

import com.fulu.game.bi.entity.bo.channel.GameCategoryListBO;
import com.fulu.game.bi.entity.dto.GameCategoryListDTO;
import com.fulu.game.bi.entity.vo.Result;
import com.fulu.game.bi.redis.service.play.GameCategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 游戏陪玩-陪玩品类
 */
@RestController
@RequestMapping("/api/play/category")
@Slf4j
public class GamePlayGategoryController {
    @Autowired
    private GameCategoryService gameCategoryService;

    /**
     * 游戏陪玩-陪玩品类-列表
     */
    @RequestMapping("/list")
    public Result list(GameCategoryListDTO dto) {
        GameCategoryListBO bo = new GameCategoryListBO();
        BeanUtils.copyProperties(dto, bo);
        return Result.success().data(gameCategoryService.list(bo));
    }

    /**
     * 游戏陪玩-陪玩品类-导出
     */
    @RequestMapping("/export")
    public void export(GameCategoryListDTO dto) {
        GameCategoryListBO bo = new GameCategoryListBO();
        BeanUtils.copyProperties(dto, bo);
        gameCategoryService.export(bo);
    }

}
